home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus 1998 #1
/
Amiga Plus 1998 #1.iso
/
demo-versionen
/
haage&partner
/
warpup-warpos
/
source
/
multitasking.p
next >
Wrap
Text File
|
1997-09-24
|
11KB
|
315 lines
incdir include:
incdir lvo:
** '(C) Copyright 1997 Haage & Partner Computer GmbH'
** All Rights Reserved
include powerpc/ppcmacros.i
include powerpc/powerpc.i
include powerpc/tasksppc.i
include dos/dos.i
include powerpc_lib.i
include exec_lib.i
include dos_lib.i
xref _SysBase
xref _DOSBase
xref _PowerPCBase
xref _LinkerDB
smalldata
executable
escapestr
version 8
start
prolog 1024
pushgpr r30/r31
la r31,TaskPtrs-4
la r4,Task1
CALLPOWERPC CreateTaskPPC
stwu r3,4(r31)
la r4,Task2
CALLPOWERPC CreateTaskPPC
stwu r3,4(r31)
la r4,Task3
CALLPOWERPC CreateTaskPPC
stwu r3,4(r31)
la r4,Task4
CALLPOWERPC CreateTaskPPC
stwu r3,4(r31)
la r4,Task5
CALLPOWERPC CreateTaskPPC
stwu r3,4(r31)
la r4,Task6
CALLPOWERPC CreateTaskPPC
stwu r3,4(r31)
la r4,Task7
CALLPOWERPC CreateTaskPPC
stwu r3,4(r31)
la r4,Task8
CALLPOWERPC CreateTaskPPC
stwu r3,4(r31)
la r4,Task9
CALLPOWERPC CreateTaskPPC
stwu r3,4(r31)
la _d1,welcome
la _d2,Args
RUN68K_XL _DOSBase,VPrintf
liw r4,SIGBREAKF_CTRL_C
CALLPOWERPC WaitPPC
la _d1,sendsigs
la _d2,Args
RUN68K_XL _DOSBase,VPrintf
la r31,TaskPtrs-4
li r30,9
.loop
lwzu r4,4(r31)
liw r5,$00010000
CALLPOWERPC SignalPPC
subic. r30,r30,1
bne .loop
liw _d1,100
RUN68K _DOSBase,Delay
popgpr
epilog
T1_Code
prolog 1024
la r3,T1_Win
la r4,T1_Text
bl Loop
epilog
T2_Code
prolog 1024
la r3,T2_Win
la r4,T2_Text
bl Loop
epilog
T3_Code
prolog 1024
la r3,T3_Win
la r4,T3_Text
bl Loop
epilog
T4_Code
prolog 1024
la r3,T4_Win
la r4,T4_Text
bl Loop
epilog
T5_Code
prolog 1024
la r3,T5_Win
la r4,T5_Text
bl Loop
epilog
T6_Code
prolog 1024
la r3,T6_Win
la r4,T6_Text
bl Loop
epilog
T7_Code
prolog 1024
la r3,T7_Win
la r4,T7_Text
bl Loop
epilog
T8_Code
prolog 1024
la r3,T8_Win
la r4,T8_Text
bl Loop
epilog
T9_Code
prolog 1024
la r3,T9_Win
la r4,T9_Text
bl Loop
epilog
Loop
pushlr
pushgpr r27-r31
mr r27,r3
mr r28,r4
li r4,16
CALLPOWERPC AllocSignalPPC
mr r29,r3
li r4,1
slw r30,r4,r3
mr _d1,r27
liw _d2,MODE_NEWFILE
RUN68K_XL _DOSBase,Open
mr r31,_d0
.loop
mr _d1,r31
mr _d2,r28
la _d3,Args
RUN68K_XL _DOSBase,VFPrintf
li r4,0
li r5,0
CALLPOWERPC SetSignalPPC
and. r3,r3,r30
beq .loop
mr _d1,r31
la _d2,sigsrec
la _d3,Args
RUN68K_XL _DOSBase,VFPrintf
mr r4,r29
CALLPOWERPC FreeSignalPPC
popgpr
epilog
section data
welcome dc.b "Welcome to the WarpOS multitasking demonstration\n"
dc.b "Press CTRL-C to quit (The PPC will wait for CTRL_C itself!)\n",0
sendsigs dc.b "Sending signals to all child tasks\n",0
sigsrec dc.b "Signal received\n"
dc.b "Removing task\n",0
even
Task1 dc.l TASKATTR_CODE
dc.l T1_Code
dc.l TASKATTR_NAME
dc.l T1_Name
dc.l TASKATTR_R2
dc.l _LinkerDB
dc.l TASKATTR_MOTHERPRI
dc.l -1
dc.l 0
T1_Win dc.b "CON:0/0/266/200/PPC task 'DemoTask1'/AUTO/CLOSE/WAIT/INACTIVE",0
T1_Text dc.b "PPC task 'DemoTask1' active\n"
dc.b "Waiting for a signal\n",0
T1_Name dc.b "DemoTask1",0
even
Task2 dc.l TASKATTR_CODE
dc.l T2_Code
dc.l TASKATTR_NAME
dc.l T2_Name
dc.l TASKATTR_R2
dc.l _LinkerDB
dc.l TASKATTR_MOTHERPRI
dc.l -1
dc.l 0
T2_Win dc.b "CON:266/0/266/200/PPC task 'DemoTask2'/AUTO/CLOSE/WAIT/INACTIVE",0
T2_Text dc.b "PPC task 'DemoTask2' active\n"
dc.b "Waiting for a signal\n",0
T2_Name dc.b "DemoTask2",0
even
Task3 dc.l TASKATTR_CODE
dc.l T3_Code
dc.l TASKATTR_NAME
dc.l T3_Name
dc.l TASKATTR_R2
dc.l _LinkerDB
dc.l TASKATTR_MOTHERPRI
dc.l -1
dc.l 0
T3_Win dc.b "CON:532/0/266/200/PPC task 'DemoTask3'/AUTO/CLOSE/WAIT/INACTIVE",0
T3_Text dc.b "PPC task 'DemoTask3' active\n"
dc.b "Waiting for a signal\n",0
T3_Name dc.b "DemoTask3",0
even
Task4 dc.l TASKATTR_CODE
dc.l T4_Code
dc.l TASKATTR_NAME
dc.l T4_Name
dc.l TASKATTR_R2
dc.l _LinkerDB
dc.l TASKATTR_MOTHERPRI
dc.l -1
dc.l 0
T4_Win dc.b "CON:0/200/266/200/PPC task 'DemoTask4'/AUTO/CLOSE/WAIT/INACTIVE",0
T4_Text dc.b "PPC task 'DemoTask4' active\n"
dc.b "Waiting for a signal\n",0
T4_Name dc.b "DemoTask4",0
even
Task5 dc.l TASKATTR_CODE
dc.l T5_Code
dc.l TASKATTR_NAME
dc.l T5_Name
dc.l TASKATTR_R2
dc.l _LinkerDB
dc.l TASKATTR_MOTHERPRI
dc.l -1
dc.l 0
T5_Win dc.b "CON:266/200/266/200/PPC task 'DemoTask5'/AUTO/CLOSE/WAIT/INACTIVE",0
T5_Text dc.b "PPC task 'DemoTask5' active\n"
dc.b "Waiting for a signal\n",0
T5_Name dc.b "DemoTask5",0
even
Task6 dc.l TASKATTR_CODE
dc.l T6_Code
dc.l TASKATTR_NAME
dc.l T6_Name
dc.l TASKATTR_R2
dc.l _LinkerDB
dc.l TASKATTR_MOTHERPRI
dc.l -1
dc.l 0
T6_Win dc.b "CON:532/200/266/200/PPC task 'DemoTask6'/AUTO/CLOSE/WAIT/INACTIVE",0
T6_Text dc.b "PPC task 'DemoTask6' active\n"
dc.b "Waiting for a signal\n",0
T6_Name dc.b "DemoTask6",0
even
Task7 dc.l TASKATTR_CODE
dc.l T7_Code
dc.l TASKATTR_NAME
dc.l T7_Name
dc.l TASKATTR_R2
dc.l _LinkerDB
dc.l TASKATTR_MOTHERPRI
dc.l -1
dc.l 0
T7_Win dc.b "CON:0/400/266/200/PPC task 'DemoTask7'/AUTO/CLOSE/WAIT/INACTIVE",0
T7_Text dc.b "PPC task 'DemoTask7' active\n"
dc.b "Waiting for a signal\n",0
T7_Name dc.b "DemoTask7",0
even
Task8 dc.l TASKATTR_CODE
dc.l T8_Code
dc.l TASKATTR_NAME
dc.l T8_Name
dc.l TASKATTR_R2
dc.l _LinkerDB
dc.l TASKATTR_MOTHERPRI
dc.l -1
dc.l 0
T8_Win dc.b "CON:266/400/266/200/PPC task 'DemoTask8'/AUTO/CLOSE/WAIT/INACTIVE",0
T8_Text dc.b "PPC task 'DemoTask8' active\n"
dc.b "Waiting for a signal\n",0
T8_Name dc.b "DemoTask8",0
even
Task9 dc.l TASKATTR_CODE
dc.l T9_Code
dc.l TASKATTR_NAME
dc.l T9_Name
dc.l TASKATTR_R2
dc.l _LinkerDB
dc.l TASKATTR_MOTHERPRI
dc.l -1
dc.l 0
T9_Win dc.b "CON:532/400/266/200/PPC task 'DemoTask10'/AUTO/CLOSE/WAIT/INACTIVE",0
T9_Text dc.b "PPC task 'DemoTask9' active\n"
dc.b "Waiting for a signal\n",0
T9_Name dc.b "DemoTask9",0
even
section bss
ds.b 32
Args ds.l 1
TaskPtrs dsb.l 9
ds.b 32
even